<style>@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}</style>
<style>

  #visitorTabContent{
    top: 84px;
  }
  #visitorTabContent ion-content{
    bottom: 135px;
  }
  .platform-ios.platform-cordova:not(.fullscreen) #visitorTabContent{
    top: 104px;
  }
  .platform-ios.platform-cordova:not(.fullscreen) #visitorTabContent ion-content{
    bottom: 150px;
  }
  .platform-ios.platform-cordova:not(.fullscreen) .visitor-tab{
    margin-top: 64px;
  }

  .row + .row{
    margin-top: 0;
  }
  .padding-left-15{
    padding-left: 15px;
  }
  .default-none{
    display: none;
  }
</style>
<ion-view title="客户管理" >
  <!--<ion-header-bar class="bar-stable bar bar-header" align-title="center">-->
    <!--<button class="button button-clear" style="padding-left: 15px;margin-top: -2px" ui-sref="app.shopsIndex">-->
      <!--&lt;!&ndash;自定义返回图标&ndash;&gt;-->
      <!--<i style="display: block;width: 22px;height:22px;background: url('img/back.png') center/22px 22px"></i>-->
    <!--</button>-->
    <!--<div class="title title-center header-item">客户管理</div>-->
    <!--<button class="button" ui-sref="addClient()" style="border: none">-->
      <!--<span style="color: #666">新增客户</span>-->
    <!--</button>-->
  <!--</ion-header-bar>-->
<!--ion-header-bar  <ion-nav-buttons side="right">-->
    <!--<button class="button" ui-sref="addClient()" style="border: none">-->
      <!--<span style="color: #666">新增客户</span>-->
    <!--</button>-->
  <!--</ion-nav-buttons>-->

  <ion-header-bar class="index_head">

    <button class="button button-icon icon ion-android-arrow-back"  ng-click="$ionicGoBack()" style="color: #fff"></button>
    <div class="h1 title">客户管理</div>
    <button class="button button-clear button-positive zhuce_head_btn" style="color: #fff;font-size: 14px;" ng-click="count_statis_btnAndPage('110602', 'addClient', phone, null, null)" >新增客户</button>
  </ion-header-bar>


  <div class="visitor-tab row" id="tabSlelist">
    <div class="text-center" ng-class="{'active':index == 0}" style="width: 50%">访客记录</div>
    <div class="text-center" ng-class="{'active':index == 1}" style="width: 50%">客户列表</div>
  </div>
    <ion-pane id="visitorTabContent">
      <ion-content style="top: 0;" delegate-handle="mainScroll" >
        <div class="visitor-content kehu_foot" ng-if="index == 0">
          <div class="visitor-remark" ng-if="visitorList.length > 0">点击访客名称可查看他的浏览记录</div>
          <div class="visitor-item row" ng-repeat="v in visitorList">
            <div class="col-80 row" ui-sref="visitorDetail({weixinAppid:v.weixinAppid})">
              <div style="width: 50px;height: 50px">
                <img src="img/h.png" ng-if="!v.photo" style="height: 100%;width: 100%;border-radius: 50%;margin-top: 10px">
                <img ng-src="{{v.photo}}?x-oss-process=image/resize,w_750" ng-if="v.photo" style="height: 100%;width: 100%;border-radius: 50%;margin-top: 10px">
              </div>
              <div class="col padding-left-15">
                <div class="visitor-item-title">{{v.nickName}}</div>
                <div class="visitor-item-source" ng-if="v.weixinAppid">来源：微信</div>
                <div class="visitor-item-source" ng-if="v.weixinAppid">{{v.createDate}}</div>
              </div>
            </div>
            <div class="col-20" ui-sref="clientDetail({id:v.clientId})" ng-if="v.clientId">
              <div class="inline-block has-client-btn"　 style="padding-top: 33px" >
                查看客户
              </div>
            </div>
            <div class="col-20"  ng-click="addCust(v.weixinAppid)" ng-if="!v.clientId">
              <div class="inline-block add-client-btn">
                添加客户
              </div>
            </div>
          </div>
          <div id="default-none-1" class="text-center ng-hide" style="line-height: 80px;background-color: #efeff4;" ng-show="visitorList.length<=0">您还没有访问记录</div>
        </div>
        <div class="visitor-content" ng-if="index == 1">
          <div class="visitor-item weui-flex" style="padding: 5px 10px;padding-left: 15px;" ng-repeat="c in clientList" ui-sref="clientDetail({id:c.id})">

              <div style="width: 50px;height: 50px;margin-top: 5px;">
                <img src="img/h.png" ng-if="!c.photo" style="height: 100%;width: 100%;border-radius: 50%">
                <img src="{{c.photo}}" ng-if="c.photo" style="height: 100%;width: 100%;border-radius: 50%">
              </div>
              <div class=" padding-left-15 weui-flex__item">
                <div class="visitor-item-title" style="line-height: 60px">{{c.name || c.nickname}}</div>
              </div>
              <div style="line-height: 60px;font-size: 20px;">
                  <i class="ion-android-star shopstar" ng-if="c.starlevel>=1"></i>
                  <i class="ion-android-star shopstar" ng-if="c.starlevel>=2"></i>
                  <i class="ion-android-star shopstar" ng-if="c.starlevel>=3"></i>
                  <i class="ion-android-star shopstar" ng-if="c.starlevel>=4"></i>
                  <i class="ion-android-star shopstar" ng-if="c.starlevel==5"></i>
              </div>
            <div class="" style="height: 60px;width: 50px;">

              <span class="inline-block goclient-detail-icon"></span>
            </div>
          </div>

          <div id="default-none-2" class="text-center ng-hide" style="line-height: 80px;background-color: #efeff4" ng-show="clientList.length<=0">您还没有客户</div>
        </div>
        <ion-infinite-scroll ng-if="visitorPager.hasNaxtPage &&  index == 0" on-infinite="loadMore()" distance="1%" style="border: none"></ion-infinite-scroll>
        <ion-infinite-scroll ng-if="clientPager.hasNaxtPage && index == 1" on-infinite="loadMore()" distance="1%" style="border: none"></ion-infinite-scroll>
      </ion-content>
    </ion-pane>
</ion-view>